#!/bin/bash

APP_NAME=$1

if [ -z ${APP_NAME} ];
then
    echo "至少需要一个参数"
    exit 1
fi

APP_PID=$(jps -l | grep ${APP_NAME} | awk '{print $1}')
if [ -z ${APP_PID} ];
then
    echo "该应用的进程不存在"
    exit 1
fi

echo "删除进程=${APP_PID}"
kill -9 ${APP_PID}